<?php

/**
 * AccountOwner form.
 *
 * @package    form
 * @subpackage account_owner
 * @version    SVN: $Id: sfPropelFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
 */
class AccountOwnerForm extends BaseAccountOwnerForm
{
  public function configure()
  {
      
    if($this->isNew())
      $this->validatorSchema['contact_iden'] = new sfValidatorString(array('required' => true));
    $this->widgetSchema['vat_excempt_type'] = 
      new sfWidgetFormSelect(
        array(
          'choices'=>
            array_combine(
              sfConfig::get('app_selection_vat_excempt_type'),
              sfConfig::get('app_selection_vat_excempt_type')
            ),
        )
      );

    $this->widgetSchema->setLabels(
      array(
        'sss_number'=>'SSS#',
        'health_card_number'=>'PhilHealth#',
        'home_development_fund_number'=>'PAGIBIG#',
        'tin_number'=>'TIN#',
        'vat_excempt_type'=>'VAT Excempt',
        'tax_codes'=>'Tax Codes',
      )
    );
  }
  
  public function setContactIden($c){
    $this->setDefault('contact_iden',$c);
  }
  
  public function getUrl(){
    if($this->isNew())
      return 'accountOwner/insert';
    else
      return 'accountOwner/update';
  }
  
  public function getDeleteUrl(){
    return 'accountOwner/delete?iden='.$this->getObject()->getContactIden();
  }
  
  public function getResetUrl($contact){
    if($this->isNew())
      return 'accountOwner/create?iden='.$contact->getIden();
    else
      return 'accountOwner/edit?iden='.$this->getObject()->getContactIden();
  }


}
